home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / ODF / Found / FWCommon / FWEnvDef.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  8.8 KB  |  366 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWEnvDef.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWENVDEF_H
  11. #define FWENVDEF_H
  12.  
  13. //========================================================================================
  14. // Definitions Specific to the Build Configuration
  15. //========================================================================================
  16.  
  17. #ifndef FWBLDDEF_H
  18. #include "FWBldDef.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. // Wrappers for C
  23. //========================================================================================
  24.  
  25. #ifdef __cplusplus
  26.  
  27.     // C++ compilation
  28.     
  29. #define FW_EXTERN_C_BEGIN    \
  30.     extern "C" \
  31.     {
  32. #define FW_EXTERN_C_END        \
  33.     }
  34.     
  35. #else
  36.  
  37.     // Good 'ol C compilation
  38.  
  39. #define FW_EXTERN_C_BEGIN
  40. #define FW_EXTERN_C_END
  41.  
  42. #endif
  43.  
  44. //========================================================================================
  45. // Metrowerks -- Macintosh
  46. //========================================================================================
  47.  
  48. #if    defined __MWERKS__ && defined FW_BUILD_MAC
  49.     
  50.     #if 0x0800 <= __MWERKS__
  51.     #    if __option(exceptions)
  52.     #        define FW_NATIVE_EXCEPTIONS
  53.     #    endif
  54.     #    if __option(RTTI)
  55.     #        define FW_COMPILER_SUPPORTS_RTTI
  56.     #    endif
  57.     #endif
  58.     
  59.     #ifdef FW_BUILD_MAC68K
  60.         #ifndef FW_ODFLIB
  61.         #define FW_ODFLIB_IMPORT
  62.         #endif
  63.     #endif
  64.     
  65.     #ifndef FW_ANSI_TEMPLATE_INSTANTIATION
  66.     #define FW_ANSI_TEMPLATE_INSTANTIATION 1
  67.     #endif
  68.     
  69.     #define ppcinterfaces 1
  70.     
  71.     #ifndef OLDROUTINENAMES
  72.     #define OLDROUTINENAMES         0
  73.     #endif
  74.     
  75.     #ifndef OLDROUTINELOCATIONS
  76.     #define OLDROUTINELOCATIONS     0
  77.     #endif
  78.     
  79.     // Hack to control what is exported from a CFM shared lib on PPC. Define functions
  80.     // with indicative names which CodeWarrior will place in the .exp file. The MPW tool
  81.     // MWExportTool will then filter the .exp removing exports between off functions and
  82.     // on functions, inclusive. The functions are dead-stripped since they are not exported
  83.     // and never referenced.
  84.     
  85.     #define FW_EXPORT_ON(file, id) \
  86.         extern "C" void _FW_export_lib_on_##file##id(); \
  87.         extern "C" void _FW_export_lib_on_##file##id() { }
  88.     #define FW_EXPORT_OFF(file, id) \
  89.         extern "C" void _FW_export_lib_off_##file##id(); \
  90.         extern "C" void _FW_export_lib_off_##file##id() { }
  91.     
  92.     #define FW_FOUR_BYTE_INTS __fourbyteints__
  93.  
  94.     // Force PowerPC alignment
  95.     #ifndef FW_BUILD_MAC68K
  96.         #pragma options align=power
  97.     #endif
  98.     
  99. //========================================================================================
  100. // Metrowerks -- Windows
  101. //========================================================================================
  102. #elif    defined __MWERKS__ && defined FW_BUILD_WIN
  103.  
  104.     #if __option(exceptions)
  105.     #    define FW_NATIVE_EXCEPTIONS
  106.     #endif
  107.  
  108.     #if __option(RTTI)
  109.     #    define FW_COMPILER_SUPPORTS_RTTI
  110.     #endif
  111.     
  112.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  113.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  114.     #endif
  115.     
  116.     #define FW_HAS_INSTANCE_DATA
  117.  
  118.     #define FW_FOUR_BYTE_INTS            1
  119.  
  120.     // Get some standard definitions
  121.     #include <ansi_prefix.win32.h>
  122.  
  123. //========================================================================================
  124. // Symantec C++ -- Macintosh
  125. //========================================================================================
  126. #elif defined SYMANTEC_CPLUS && !defined _WINDOWS
  127.     
  128.     #pragma options(system_includes_from_project_tree)
  129.     
  130.     #define FW_AGGRESSIVE_PRECOMPILE 1
  131.             
  132.     #ifndef FW_ANSI_TEMPLATE_INSTANTIATION
  133.     #define FW_ANSI_TEMPLATE_INSTANTIATION 1
  134.     #endif
  135.  
  136.     #define PRAGMA_LIB_EXPORT 1
  137.     #define PRAGMA_IMPORT 1
  138.     
  139.     #ifndef SOMLINK
  140.     #define SOMLINK
  141.     #endif
  142.     
  143.     #ifndef SOMDLINK
  144.     #define SOMDLINK
  145.     #endif
  146.     
  147.     #ifndef FW_BUILD_MAC
  148.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  149.     #endif
  150.     
  151.     #define ppcinterfaces 1
  152.     
  153.     #ifndef OLDROUTINENAMES
  154.     #define OLDROUTINENAMES         0
  155.     #endif
  156.     
  157.     #ifndef OLDROUTINELOCATIONS
  158.     #define OLDROUTINELOCATIONS     0
  159.     #endif
  160.     
  161.     #define FW_EXPORT_ON
  162.     #define FW_EXPORT_OFF
  163.     
  164.     #ifndef FW_FOUR_BYTE_INTS
  165.     #define FW_FOUR_BYTE_INTS __option(int_4)
  166.     #endif
  167.  
  168.     // Force PowerPC alignment
  169.     #pragma options align=power
  170.  
  171. //========================================================================================
  172. // CFM 68K using Symantec SCpp (__SC__ would also catch SPM but that's listed above)
  173. //========================================================================================
  174. #elif defined __SC__ && !defined _WINDOWS
  175.     
  176.     #define FW_AGGRESSIVE_PRECOMPILE 1
  177.     
  178.     #ifndef FW_ANSI_TEMPLATE_INSTANTIATION
  179.     #define FW_ANSI_TEMPLATE_INSTANTIATION 1
  180.     #endif
  181.  
  182.     // We want clients of the ODF library to turn on
  183.     // the import pragmas.  Define FW_ODFLIB only when building
  184.     // the ODF shared library. -  [sfu]
  185.     
  186.     #ifndef FW_ODFLIB
  187.     #define FW_ODFLIB_IMPORT
  188.     #endif
  189.         
  190.     #ifndef SOMLINK
  191.     #define SOMLINK
  192.     #endif
  193.     
  194.     #ifndef SOMDLINK
  195.     #define SOMDLINK
  196.     #endif
  197.     
  198.     #ifndef FW_BUILD_MAC
  199.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  200.     #endif
  201.     
  202.     #define ppcinterfaces 1
  203.  
  204.     #ifndef OLDROUTINENAMES
  205.     #define OLDROUTINENAMES         0
  206.     #endif
  207.     
  208.     #ifndef OLDROUTINELOCATIONS
  209.     #define OLDROUTINELOCATIONS     0
  210.     #endif
  211.     
  212.     #define FW_EXPORT_ON
  213.     #define FW_EXPORT_OFF
  214.     
  215.     #ifndef FW_FOUR_BYTE_INTS
  216.     #define FW_FOUR_BYTE_INTS __option(int_4)
  217.     #endif
  218.     
  219. //========================================================================================
  220. // Mr. C -- Macintosh
  221. //========================================================================================
  222. #elif defined __MRC__
  223.  
  224.     #ifndef FW_USE_TEMPLATE_PRAGMAS
  225.     #define FW_USE_TEMPLATE_PRAGMAS 1
  226.     #endif
  227.     
  228.     // We want clients of the ODF library to turn on
  229.     // the import pragmas.  Define FW_ODFLIB only when building
  230.     // the ODF shared library. -  [sfu]
  231.  
  232.     #ifndef FW_ODFLIB
  233.     #define FW_ODFLIB_IMPORT
  234.     #endif
  235.     
  236.     #ifndef FW_BUILD_MAC
  237.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  238.     #endif
  239.     
  240.     #define ppcinterfaces 1
  241.  
  242.     #ifndef OLDROUTINENAMES
  243.     #define OLDROUTINENAMES         0
  244.     #endif
  245.     
  246.     #ifndef OLDROUTINELOCATIONS
  247.     #define OLDROUTINELOCATIONS     0
  248.     #endif
  249.  
  250.     #define FW_EXPORT_ON
  251.     #define FW_EXPORT_OFF
  252.     
  253.     #define FW_FOUR_BYTE_INTS 1
  254.  
  255.     // Force PowerPC alignment
  256.     #pragma options align=power
  257.  
  258. //========================================================================================
  259. // Microsoft Visual C++ - Windows
  260. //========================================================================================
  261. #elif defined _MSC_VER
  262.  
  263. //    [jkp] 961010
  264. //    Commented out this check.  I asked Henri, and he couldn't think of *why* 
  265. //    we'd even care...
  266.  
  267. //    #ifdef _WINDOWS_
  268. //    #error Include FWEnvDef.h before including Windows.h
  269. //    #endif
  270.  
  271.     #define FW_BUILD_WIN
  272.     #define FW_BUILD_WIN32
  273.     #define FW_HAS_INSTANCE_DATA
  274.     #define FW_NATIVE_EXCEPTIONS
  275.     #define FW_COMPILER_SUPPORTS_RTTI
  276.  
  277.     #define FW_FOUR_BYTE_INTS            1
  278.     
  279.     #ifdef _DEBUG
  280.     #define    FW_DEBUG
  281.     #endif
  282.  
  283.     #define PLATFORM_WINDOWS            1
  284.  
  285.     #pragma warning(disable:4080)        // Invalid name in segment pragma
  286.     #pragma warning(disable:4660)        // Template specialization already instantiated
  287.  
  288. //========================================================================================
  289. // Symantec C++ - Windows
  290. //========================================================================================
  291. #elif defined __SC__ && defined _WINDOWS
  292.  
  293. //    [jkp] 961010
  294. //    Commented out this check.  I asked Henri, and he couldn't think of *why* 
  295. //    we'd even care...
  296.  
  297. //    #ifdef _WINDOWS_
  298. //    #error Include FWEnvDef.h before including Windows.h
  299. //    #endif
  300.  
  301.     #define FW_BUILD_WIN
  302.     #define FW_BUILD_WIN32
  303.     #define FW_HAS_INSTANCE_DATA
  304.     #define FW_NATIVE_EXCEPTIONS
  305.  
  306.     #define FW_FOUR_BYTE_INTS            1
  307.     #define FW_AGGRESIVE_PRECOMPILE        1
  308.  
  309.     #ifdef _DEBUG
  310.     #define    FW_DEBUG
  311.     #endif
  312.  
  313.     #define PLATFORM_WINDOWS            1
  314.  
  315. //========================================================================================
  316. // Unsupported Compiler
  317. //========================================================================================
  318. #else
  319.  
  320.     #error Unsupported compiler
  321.  
  322. #endif
  323.  
  324. //========================================================================================
  325. // Other Defines 
  326. //========================================================================================
  327.  
  328. #ifdef FW_BUILD_MAC
  329.     #ifndef _PLATFORM_MACINTOSH_
  330.         #define _PLATFORM_MACINTOSH_         1
  331.     #endif
  332.     #ifndef PLATFORM_MACINTOSH
  333.         #define PLATFORM_MACINTOSH             1
  334.     #endif
  335.  
  336.     #if !defined(FW_HAS_INSTANCE_DATA)
  337.         #define FW_HAS_INSTANCE_DATA
  338.     #endif
  339.     
  340.     #ifdef FW_NATIVE_EXCEPTIONS
  341.     #    define _NATIVE_EXCEPTIONS_
  342.     #endif
  343.     
  344.     #define FW_EXPORT
  345. #endif
  346.  
  347. #ifdef FW_BUILD_WIN
  348.     #ifndef _PLATFORM_WINDOWS_
  349.         #define _PLATFORM_WINDOWS_            1
  350.     #endif
  351.     #ifndef PLATFORM_WINDOWS
  352.         #define PLATFORM_WINDOWS             1
  353.     #endif
  354.     #ifndef _PLATFORM_WIN32_
  355.         #define _PLATFORM_WIN32_            1
  356.     #endif
  357.  
  358.     #ifdef FW_NATIVE_EXCEPTIONS
  359.     #    define _NATIVE_EXCEPTIONS_
  360.     #endif
  361.     
  362.     #define FW_EXPORT                        __declspec(dllexport)
  363. #endif
  364.  
  365. #endif
  366.